<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
    
<div id="aa">
<h2> 로그인  </h2>
	<hr />
	<c:choose>
	<c:when test="${empty userSession}">
		<form:form commandName="user" name="user" action="/login.plan" method="post">
			<dl>
				<dt><form:label path="userId">아이디</form:label></dt>
				<dd><form:input path="userId" />
					<form:errors path="userId" />
				</dd>
				<dt><form:label path="password">비밀번호</form:label></dt>
				<dd><form:password path="password" />
					<form:errors path="password" />
				</dd>
			</dl>
		<input type="button" value="AJAX로그인" onclick="req()" />
		<input type="submit" value="로그인" onclick="req()" />
		</form:form>
	</c:when>
	<c:otherwise>
		<a href="/logout.plan">로그아웃 </a>
	</c:otherwise>
	</c:choose>
	<hr />
	<a href="/index.plan">메인으로</a>
</div>